(use-modules (trs examples))
(use-modules (srfi srfi-64))

(test-begin "free-group")
(test-equal (free-group `(* (* (/ a) a) (* b (/ b))))
  '(e))
(test-equal "free-group"
  ;; verify the axiom from
  ;; G. Higman and B. H. Neumann. Groups as groupoids with one law [1952]
  (let ((/ (lambda (a b) `(* ,a (/ ,b)))))
    (free-group (/ 'x (/ (/ (/ (/ 'x 'x) 'y) 'z) (/ (/ (/ 'x 'x) 'x) 'z)))))
  'y)
(test-end "free-group")
